<?php

namespace app\home\controller\user;

use app\home\controller\AuthController;
use app\home\model\user\User as UserModel;
use app\home\model\user\UserBill;
use services\{JsonService as Json, UtilService as Util};
use think\facade\Route;


/**
 * 会员的消费的模型
 * Class Salary
 * @package app\home\controller\user
 */
class Salary extends AuthController
{
    public function index()
    {
        // 获取所有的会员
        $user_list = UserModel::allUser();
        $this->assign(compact("user_list"));
        return $this->fetch();
    }

    /**
     * 获取所有的用户的消费记录
     */
    public function salary_list()
    {
        // 获取所有的订单 UserBIll表
        $where = Util::getMore([
            ["page", 1],
            ["limit", 20],
            ["nickname", ''],
            ["license_no", ""],
            ["recent_time", ""],
            ["user_time_type", ""]
        ], $this->request);
        $data = UserBill::getAllBill($where);
        return Json::successlayui($data);
    }
}